package com.tedu._05springmvc.controller;

import com.tedu._05springmvc.pojo.dto.UserRegDTO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {
    @RequestMapping("/user/login")
    @ResponseBody
    public String login(String username, String password) {
        return "欢迎你，" + username + "您的密码是：" + password;
    }

    @RequestMapping("/user/reg")
    @ResponseBody
    public String register(UserRegDTO userRegDTO) {
        String name = userRegDTO.getName();
        return "恭喜：" + name + ",注册成功";
    }
}
